inspector: Minimal support for gestures
authorMatthias Clasen <mclasen@redhat.com>
Fri, 16 May 2014 18:27:58 +0000 (14:27 -0400)
committerCarlos Garnacho <carlosg@gnome.org>
Fri, 23 May 2014 17:54:32 +0000 (19:54 +0200)
We're just showing them as objects in the tree, for now.

gtk/inspector/widget-tree.c

index 6b3f69fbde6cc781e7c85a375364f4186bd19ac9..62dc1a0465e161dd60ccde990b1e313d0913061a 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "prop-list.h"
 #include "widget-tree.h"
+#include "gtkwidgetprivate.h"
 #include <string.h>
 
 enum
@@ -316,6 +317,33 @@ gtk_inspector_widget_tree_append_object (GtkInspectorWidgetTree *wt,
 
   g_free (address);
 
+  if (GTK_IS_WIDGET (object))
+    {
+      struct {
+        GtkPropagationPhase  phase;
+        const gchar         *name;
+      } phases[] = {
+        { GTK_PHASE_CAPTURE, "capture" },
+        { GTK_PHASE_TARGET,  "target" },
+        { GTK_PHASE_BUBBLE,  "bubble" },
+        { GTK_PHASE_NONE,    "" }
+      };
+      gint i;
+
+      for (i = 0; i < G_N_ELEMENTS (phases); i++)
+        {
+          GList *list, *l;
+
+          list = _gtk_widget_list_controllers (GTK_WIDGET (object), phases[i].phase);
+          for (l = list; l; l = l->next)
+            {
+              GObject *controller = l->data;
+              gtk_inspector_widget_tree_append_object (wt, controller, &iter, phases[i].name);
+            }
+          g_list_free (list);
+        }
+    }
+
   if (GTK_IS_CONTAINER (object))
     {
       FindAllData data;